$(function () {
            var $btn_menu = $('.btn_menu a'),
                $menu = $('.menu'),
                $menucontent = $('.menucontent');

            $btn_menu.toggle(
                function () {
                    var menuH = $menucontent.outerHeight();

                    $menu.animate({
                        'height': menuH
                    }, 1000, function () {
                        $menu.css({
                            'height': 'auto'
                        });
                    });
                }, function () {
                    $menu.animate({
                        'height': 0
                    });
                }
            );
        });

$(window).resize(function(){
    if($("#ideaPage").length>0){
        $(".fb-comments").attr("data-width", $("#ideaPage").width());
        $(".fb-like-box").attr("data-width", $("#ideaPage").width());
        FB.XFBML.parse($("#ideaPage")[0]);
    }
    else if($("#themePage").length>0){
        $(".fb-comments").attr("data-width", $("#themePage").width());
        $(".fb-like-box").attr("data-width", $("#themePage").width());
        FB.XFBML.parse($("#themePage")[0]);
    }
 
});

function reParseFBplugin(){
    
    if(typeof FB == 'function'){
        if($("#ideaPage").length>0){
            FB.XFBML.parse($("#ideaPage")[0]);
        }
        else if($("#themePage").length>0){
            FB.XFBML.parse($("#themePage")[0]);    
        }
    }
    else{
        window.setTimeout("reParseFBplugin()",1000);
    }
}

jQuery(document).ready(function($)  
{

    /*initial fb plugin width*/
    
    if($("#ideaPage").length>0){
        $(".fb-comments").attr("data-width", $("#ideaPage").width());
        $(".fb-like-box").attr("data-width", $("#ideaPage").width());
    }
    else if($("#themePage").length>0){
        $(".fb-comments").attr("data-width", $("#themePage").width());
        $(".fb-like-box").attr("data-width", $("#themePage").width());
    }

    reParseFBplugin();
});  